package com.mjw.zstu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mjw.zstu.entity.Product;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
public interface ProductMapper extends BaseMapper<Product> {
    @Select("select count(*) as value,product_id  from orderlist group by product_id order by value desc limit 0,10")
    public List<Map> ten();
    @Select("select company.company_name,product.name from product,company where product.company_id=company.company_id and product.id=#{id}")
    public Map detail(int id);
}
